<div class="modal fade personal-add" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true"
  id="update">
  <div class="modal-dialog modal-lg modal-lg-f management-modal modal-dialog-centered modal-lg-fa" role="document">
    <div class="modal-content">
      <div class="modal-header">
        
        <h4 class="modal-title" id="myModalLabel">个人用户-修改</h4>
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
      </div>
      <form #FormUpdate="ngForm" novalidate *ngIf="getTabVal">
        
        <div class="popup-body modal-body">
          <div class="col-xs-12 col-sm-6">
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right" for="dhName">用户名：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" name="userName" #userName=ngModel autocomplete="off" class="form-control hide" [(ngModel)]="getTabVal.userName"/>
                <p>{{getTabVal.userName}}</p>
              </div>
            </div>
            
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right" for="dhName">昵称：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" name="displayName" #displayName=ngModel autocomplete="off" class="form-control" [(ngModel)]="getTabVal.displayName" placeholder="请输入昵称,只能输入英文和汉字"
                pattern="^[a-zA-Z\d\u4E00-\u9FA5_]+$"  required />
                <label class="red required">*</label>
                <div *ngIf="displayName.invalid && (displayName.touched)" class="error-alert">
                  <div *ngIf="displayName.errors.required">
                    <small class="error">请输入昵称</small>
                    <small class="error" *ngIf="displayName.errors?.pattern ">不能输入特殊符号,允许输入_</small>
                  </div>
                </div>
              </div>
            </div>
            
              <div class="form-group">
                  <label class="col-xs-12 col-sm-3 control-label text-right">角色：</label>
                  <div class="col-xs-12 col-sm-9">
                    <select class="form-control" name="roleId" #roleId=ngModel [(ngModel)]="getTabVal.roleId" required>
                      <option *ngFor="let item of roledata" [value]='item.roleId'>{{item.roleName}}</option>
                    </select>
                    <div *ngIf="roleId.invalid && (roleId.touched)" class="error-alert">
                      <div *ngIf="roleId.errors.required">
                        <small class="error">请选择所属角色</small>
                      </div>
                    </div>
                  </div> 
                </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">性别：</label>
              <div class="col-xs-12 col-sm-9">
                <div class="radiogroup">
                  <p-radioButton class="radio-p" name="sex" value="1" label="男" [(ngModel)]="getTabVal.sex" inputId="preop1"></p-radioButton>
                  <p-radioButton class="radio-p" name="sex" value="2" label="女" [(ngModel)]="getTabVal.sex" inputId="preop2"></p-radioButton>
                </div>
              </div>
            </div>
            

            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">用户状态：</label>
              <div class="col-xs-12 col-sm-9">
                <!-- <select name="status" #status=ngModel [(ngModel)]="getTabVal.status" required>
                  <option value="">请选择</option>
                  <option value="0">禁用</option>
                  <option value="1">启用</option>
                </select>
                <div *ngIf="status.invalid && (status.dirty || status.touched)" class="error-alert">
                  <div *ngIf="status.errors.required">
                    <small class="error">请选择用户状态</small>
                  </div>
                </div> -->
                <label class="toggle toggle-positive">
                  <input type="checkbox" name="status" #status=ngModel [(ngModel)]="getTabVal.status" >
                  <div class="track">
                      <div class="tit" *ngIf="getTabVal.status">启用</div>
                      <div class="tit right" *ngIf="!getTabVal.status">禁用</div>
                      <div class="handle"></div>
                  </div>
                </label> 
              </div>
            </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">邮箱激活状态：</label>
              <div class="col-xs-12 col-sm-9">
                <!-- <select name="isActivate" #isActivate=ngModel [(ngModel)]="getTabVal.isActivate" required>
                  <option value="">请选择</option>
                  <option value="0">未激活</option>
                  <option value="1">激活</option>
                </select>
                <div *ngIf="isActivate.invalid && (isActivate.dirty || isActivate.touched)" class="error-alert">
                  <div *ngIf="isActivate.errors.required">
                    <small class="error">请选择邮箱激活状态</small>
                  </div>
                </div> -->
                <label class="toggle toggle-positive">
                  <input type="checkbox" name="isActivate" #isActivate=ngModel [(ngModel)]="getTabVal.isActivate" >
                  <div class="track">
                      <div class="tit" *ngIf="getTabVal.isActivate">激活</div>
                      <div class="tit right" *ngIf="!getTabVal.isActivate">未激活</div>
                      <div class="handle"></div>
                  </div>
                </label> 
              </div>
            </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">实名认证状态：</label>
              <div class="col-xs-12 col-sm-9">
                <!-- <select name="isAutonym" #isAutonym=ngModel [(ngModel)]="getTabVal.isAutonym" required>
                  <option value="">请选择</option>
                  <option value="0">未认证</option>
                  <option value="1">认证</option>
                </select>
                <div *ngIf="isAutonym.invalid && (isAutonym.dirty || isAutonym.touched)" class="error-alert">
                  <div *ngIf="isAutonym.errors.required">
                    <small class="error">请选择实名认证状态</small>
                  </div>
                </div> -->
                <label class="toggle toggle-positive">
                  <input type="checkbox" name="isAutonym" #isAutonym=ngModel [(ngModel)]="getTabVal.isAutonym" >
                  <div class="track">
                      <div class="tit" *ngIf="getTabVal.isAutonym">认证</div>
                      <div class="tit right" *ngIf="!getTabVal.isAutonym">未认证</div>
                      <div class="handle"></div>
                  </div>
                </label>
              </div>
            </div>
          </div>
          <div class="col-xs-12 col-sm-6">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 control-label text-right">手机：</label>
                <div class="col-xs-12 col-sm-9">
                  <input type="text" name="mobile" #mobile=ngModel autocomplete="off" class="form-control" [(ngModel)]="getTabVal.mobile "
                    pattern="^1[34578]\d{9}$" />
                    <!-- <small class="error" *ngIf="mobile.errors?.required">请输入手机号码</small> -->
                  <!-- <label class="red required">*</label> -->
                  <div *ngIf="mobile.invalid && (mobile.touched)" class="error-alert">
                    
                    <small class="error" *ngIf="mobile.errors?.pattern ">请输入正确的手机号码</small>
                  </div>
                </div>
              </div>
              <div class="form-group">
                  <label class="col-xs-12 col-sm-3 control-label text-right">身份证：</label>
                  <div class="col-xs-12 col-sm-9">
                    <input type="text" name="identityCard" #identityCard=ngModel autocomplete="off" class="form-control" [(ngModel)]="getTabVal.identityCard"
                      pattern="(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)" />
                    <!-- <label class="red required">*</label> <small class="error" *ngIf="identityCard.errors?.required">请输入身份证号码</small> -->
                    <div *ngIf="identityCard.invalid && (identityCard.touched)" class="error-alert">
                     
                      <small class="error" *ngIf="identityCard.errors?.pattern">请输入正确的身份证号码</small>
                    </div>
                  </div>
                </div>
              <div class="form-group">
                  <label class="col-xs-12 col-sm-3 control-label text-right">真实姓名：</label>
                  <div class="col-xs-12 col-sm-9">
                    <input type="text" name="realName" #realName=ngModel autocomplete="off" class="form-control" [(ngModel)]="getTabVal.realName"/>
                    <!-- <label class="red required">*</label> -->
                    <!-- <div *ngIf="realName.invalid && (realName.touched)" class="error-alert">
                      <div *ngIf="realName.errors.required">
                        <small class="error">请输入真实姓名</small>
                      </div>
                    </div> -->
                  </div>  
                </div>
            
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 control-label text-right">邮箱：</label>
                <div class="col-xs-12 col-sm-9">
                  <input type="email" name="email" pattern="^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$" #email=ngModel autocomplete="off"
                    class="form-control" [(ngModel)]="getTabVal.email"/>
                  <div *ngIf="email.invalid && (email.touched)" class="error-alert">
                    <small class="error" *ngIf="email.errors?.pattern ">请输入正确的邮箱格式</small>
                  </div>
                </div>
              </div>
              <div class="form-group">
                <label class="col-xs-12 col-sm-3 control-label text-right" for="dhName">注册来源：</label>
                <div class="col-xs-12 col-sm-9">
                  <input type="text" name="registerSource" #registerSource=ngModel autocomplete="off" class="form-control" [(ngModel)]="getTabVal.registerSource"/>

                </div>
              </div>
            

            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">电话：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" name="phone" #phone=ngModel autocomplete="off" class="form-control" [(ngModel)]="getTabVal.phone" />
              </div>
            </div>

            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">生日：</label>
              <div class="col-xs-12 col-sm-9" *ngIf="getTabVal">
                <input type="text" autocomplete="off" name="birthday" #birthday=ngModel class="form-control" [(ngModel)]="getTabVal.birthday" [maxDate]="maxDate"  #dp="bsDatepicker" bsDatepicker  [bsConfig]="{ dateInputFormat: 'YYYY-MM-DD'}"/>
              </div>
            </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">城市：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" autocomplete="off" class="form-control" name="city" #city=ngModel [(ngModel)]="getTabVal.city" />
              </div>
            </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">地址：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" autocomplete="off" class="form-control" name="address" #address=ngModel [(ngModel)]="getTabVal.address"
                />
              </div>
            </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">qq号：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" autocomplete="off" class="form-control" name="qq" #qq=ngModel [(ngModel)]="getTabVal.qq" />
              </div>
            </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">邮编：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" autocomplete="off" class="form-control" name="postCode" #postCode=ngModel [(ngModel)]="getTabVal.postCode"
                />
              </div>
            </div>
            <div class="form-group">
              <label class="col-xs-12 col-sm-3 control-label text-right">学校：</label>
              <div class="col-xs-12 col-sm-9">
                <input type="text" autocomplete="off" class="form-control" name="school" #school=ngModel [(ngModel)]="getTabVal.school "
                />
              </div>
            </div>
          </div>
        </div>
        <input class="hide" type="text" name="userId"  #userId="ngModel" [(ngModel)]="update.userId">
        <input class="hide" type="text" name="createUserId"   #createUserId="ngModel" [(ngModel)]="update.createUserId">
        <input class="hide" type="text" name="institutionId"  #institutionId="ngModel" [(ngModel)]="superiorUpdateId">
        <input class="hide" type="text" name="userInfoId"  #userInfoId="ngModel" [(ngModel)]="getTabVal.userInfoId">
        <!-- <input class="hide" type="text" name="parentId" *ngIf="update"  #parentId="ngModel" [(ngModel)]="update.parentId"> -->
        <input class="hide" type="text" name="portrait"  #portrait="ngModel" [(ngModel)]="getTabVal.portrait">
        <div class="modal-footer">
          <button type="button" class="btn btn-default" mat-raised-button data-dismiss="modal">取消</button>
          <button type="button" class="btn btn-primary" mat-button [disabled]="FormUpdate?.invalid" (click)="submitEdit(FormUpdate.value)"><span class="glyphicon glyphicon-pencil"></span> 修改</button>
          <!-- [disabled]="formUpdate.invalid" -->
        </div>
      </form>  
    </div>
  </div>
</div>
<!-- 修改 END -->